<?php 
include_once("rm_conexion.class.php");

class Trackback{
 var $con;
 function Trackback(){
 	$this->con=new DBManager;
 }
 
 function listado(){
   if($this->con->conectar()==true){
     $result = @mysql_query("SELECT * FROM trackback ORDER BY added ASC");
	 return $result;
   }
 }
 
 function numero_registros(){
   if($this->con->conectar()==true){
     $result = @mysql_num_rows(mysql_query("SELECT * FROM trackback"));
	 return $result;
   }
 }
 
 function insertar($articulo_id, $blog_name, $title, $excerpt, $url){
   if($this->con->conectar()==true){
     $result = @mysql_query("INSERT INTO trackback (articulo_id, blog_name, title, excerpt, url, added) VALUES ($articulo_id, '$blog_name', '$title', '$excerpt', '$url', NOW())");
     return $result;
   }
 }

 function actualizar($id,$articulo_id, $blog_name, $title, $excerpt, $url){
   if($this->con->conectar()==true) {
     $result = @mysql_query("UPDATE trackback SET articulo_id=$articulo_id, blog_name='$blog_name', title='$title', excerpt='$excerpt', url='$url' WHERE id=$id");
     return $result;
   }
 }

 function eliminar($id){
   if($this->con->conectar()==true){
     $result = @mysql_query("DELETE FROM trackback WHERE id=$id");
     return $result;
   }
 }
 
 function mostrar($id){
   if($this->con->conectar()==true){
     $result = @mysql_query("SELECT * FROM trackback WHERE id=$id");
     return $result;
   }
 }
}
?>
